Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

332
Vistas
How to filter a list using "like" operator with a parameter in a REST aplication?

I'm building a web application using REST; more specifically, Node.js. So far, I've had no problems formatting the URL (using ? and & operators; limit and skip to filter fields, for example).

Now, I need to filter a list of Sensor Readings to show only the data that was inserted in a specific day.

The date is being stored as a String in MongoDB in the format "dd/mm/yyyy hh:mm:ss", or "25/04/2017 10:20:56". The reason I'm storing it as a String rather than as datetime is because it takes less space, as there's limitations of storage in the project.

Using the "like" operator in the URL (%, that is), I've successfully managed to filter some other String fields, such as /sensorReading/?deviceNum=MBA%. However, when I try to filter the date String, it fails.

I've tried in many different ways, but nothing is working, even when I don't use the like operator and put the full string (space is being replaced as %20):

/sensorReading/?dateString=13%
/sensorReading/?dateString=1%
/sensorReading/?dateString=%1%
/sensorReading?dateString=1%
/sensorReading/?dateString=13/04/2017%2012:57:16

My guess is that it has something to do with the '/' character present in the String, to separate day, month and year.

Is there a way to do this via URL, or will I have to do it in the front end of my aplication? For the front, I'm using JavaScript and AngularJS.

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda